<template>
  <div>
    <a-table
      row-key="id"
      :dataSource="dataSource"
      :columns="columns"
      :pagination="false"
      :customRow="tableCustomRow"
    >
      <template #bodyCell="{ column, record }">
        <OdooWidget :node="column" :formInfo="{ ...treeInfo, record }" />
      </template>
    </a-table>
  </div>
</template>

<script setup>
import OdooWidget from '@/odoojs-antdv/OWidget/OdooWidget.vue'

defineProps(['treeInfo', 'dataSource', 'columns'])
const emit = defineEmits(['row-click', 'change'])

function tableCustomRow(record) {
  return {
    // eslint-disable-next-line no-unused-vars
    onClick: event => {
      //   console.log('click row ', record)
      emit('row-click', record)
    }
  }
}
</script>

<style type="text/css"></style>
